#include "chattester.h"
#include "config.h"

#include <QApplication>
#include <QHostInfo>
#include <QTextCodec>

#include "databasemagr.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setQuitOnLastWindowClosed(false);

    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));

    Config::InitApp(a.applicationDirPath());
    // 加载数据库
    DataBaseMagr::Instance()->OpenUserDb(Config::m_strDatabasePath + "user.db");
    DataBaseMagr::Instance()->OpenMessageDb(Config::m_strDatabasePath + "msg.db");

    ChatTester w;
    w.show();

    return a.exec();
}
